package com.ruoyi.zsyh.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhServiceSettleMapper;
import com.ruoyi.zsyh.domain.ZsyhServiceSettle;
import com.ruoyi.zsyh.service.IZsyhServiceSettleService;
import com.ruoyi.common.core.text.Convert;

/**
 * 抽成结算Service业务层处理
 * 
 * @author yuexl
 * @date 2022-03-18
 */
@Service
public class ZsyhServiceSettleServiceImpl implements IZsyhServiceSettleService 
{
    @Autowired
    private ZsyhServiceSettleMapper zsyhServiceSettleMapper;

    /**
     * 查询抽成结算
     * 
     * @param id 抽成结算ID
     * @return 抽成结算
     */
    @Override
    public ZsyhServiceSettle selectZsyhServiceSettleById(String id)
    {
        return zsyhServiceSettleMapper.selectZsyhServiceSettleById(id);
    }

    /**
     * 查询抽成结算列表
     * 
     * @param zsyhServiceSettle 抽成结算
     * @return 抽成结算
     */
    @Override
    public List<ZsyhServiceSettle> selectZsyhServiceSettleList(ZsyhServiceSettle zsyhServiceSettle)
    {
        return zsyhServiceSettleMapper.selectZsyhServiceSettleList(zsyhServiceSettle);
    }

    /**
     * 新增抽成结算
     * 
     * @param zsyhServiceSettle 抽成结算
     * @return 结果
     */
    @Override
    public int insertZsyhServiceSettle(ZsyhServiceSettle zsyhServiceSettle)
    {
        zsyhServiceSettle.setCreateTime(DateUtils.getNowDate());
        return zsyhServiceSettleMapper.insertZsyhServiceSettle(zsyhServiceSettle);
    }

    /**
     * 修改抽成结算
     * 
     * @param zsyhServiceSettle 抽成结算
     * @return 结果
     */
    @Override
    public int updateZsyhServiceSettle(ZsyhServiceSettle zsyhServiceSettle)
    {
        return zsyhServiceSettleMapper.updateZsyhServiceSettle(zsyhServiceSettle);
    }

    /**
     * 删除抽成结算对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhServiceSettleByIds(String ids)
    {
        return zsyhServiceSettleMapper.deleteZsyhServiceSettleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除抽成结算信息
     * 
     * @param id 抽成结算ID
     * @return 结果
     */
    @Override
    public int deleteZsyhServiceSettleById(String id)
    {
        return zsyhServiceSettleMapper.deleteZsyhServiceSettleById(id);
    }

    public Map getMoneyAll(String agentId, String rakerId, String settleStatue){
        return zsyhServiceSettleMapper.getMoneyAll(agentId, rakerId, settleStatue);
    }
}
